package com.example.demo.controller;

import com.example.demo.dao.ClasssMybatisDao;
import com.example.demo.entity.Classs;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/classs")//给该类的所有路径添加前缀
public class ClasssController {

    @Resource
    ClasssMybatisDao classsMybatisDao;//引入Mybatis数据库操作类
    @GetMapping("/deleteMybatis")
    public String deleteMybatis(int id){
        int result = classsMybatisDao.delete(id);
        if(result==1){
            return "删除成功";
        }else {
            return "删除失败";
        }
    }

}
